package com.ruibang.glass.equipment.constant;

/**
 * @author 宋锦康
 */
public enum EquipmentErrorCode {

    PARAM_NO_PRODUCT_ERROR(10000003, "仓库暂无此物品库存"),
    LESS_PRODUCT(10000004, "仓库数量小于出库数量！请更换数量出库"),
    PARAM_ERROR(100090001, "参数错误"),
    PARAM_IS_EMPTY(100090002, "参数为空"),
    BUSINESS_MENU_IS_EMPTY(100090003, "业务菜单ID不能为空"),
    EXPORT_FILE_IS_FAILED(100090004, "导出文件异常，请检查"),
    IMPORT_FILE_IS_FAILED(100090005, "导入文件异常，请检查"),
    SPARE_PARTS_NUMBER_NAME_IS_EXIST(100090006, "备件编号已存在，请检查"),
    SPARE_PARTS_INFO_NAME_IS_EXIST(100090007, "备件信息已存在，请检查");
    private int code;
    private String msg;

    EquipmentErrorCode(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public String getMsg() {
        return msg;
    }

    public int getCode() {
        return code;
    }

    public static String getValue(int code) {
        for (EquipmentErrorCode ele : values()) {
            if (ele.getCode() == code) {
                return ele.getMsg();
            }
        }
        return null;
    }

}
